package ganga.custodian.sandbox;

/**
 * Настройка параметров сенсоров и их включение/выключение
 * @author Cuarto
 *
 */

import ganga.custodian.R;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.ArrayAdapter;
import android.widget.Spinner;

public class SetParamToSensor extends Activity implements
		OnItemSelectedListener {
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.setparam);

		Spinner sensorspeed1 = (Spinner) findViewById(R.id.sensorspeed1);
		ArrayAdapter adapter = ArrayAdapter.createFromResource(this,
				R.array.Speed, android.R.layout.simple_spinner_item);
		adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
		sensorspeed1.setAdapter(adapter);

		int i = adapter.getViewTypeCount();
	}

	public void onItemSelected(AdapterView<?> parent, View view, int pos,
			long id) {
		String selected = parent.getItemAtPosition(pos).toString();
		// use handler to access select item
	}

	public void onNothingSelected(AdapterView parent) {
		// Do nothing.
	}

}
